home *** CD-ROM | disk | FTP | other *** search
/ PC World 2008 February (DVD) / PCWorld_2008-02_DVD.iso / v cisle / PHP / PHP.exe / EasyPHP-2.0b1-setup.exe / {app} / home / index.php < prev    next >
Encoding:
PHP Script  |  2006-11-26  |  10.4 KB  |  313 lines

  1. <?php
  2. include("i18n.inc.php");
  3. ?>
  4.  
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  6.  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  7. <html>
  8. <head>
  9. <link rel="shortcut icon" href="images_easyphp/easyphp_favicon.ico" />
  10. <title>[EasyPHP] - <?php echo $administration ?></title>
  11. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  12. <link rel="stylesheet" href="styles.css" type="text/css" />
  13. </head>
  14.  
  15. <body>
  16.  
  17. <?php
  18. include("functions.inc.php");
  19. include("versions.inc.php");
  20.  
  21. if (isset($HTTP_GET_VARS))
  22. {
  23.     while(list($name, $value) = each($HTTP_GET_VARS))
  24.     {
  25.         $$name = $value;
  26.     }
  27. }
  28.     
  29. if (!isset($_GET['to'])) $_GET['to'] = '';
  30. if (!isset($_POST['to'])) $_POST['to'] = '';
  31. if (!isset($_GET['exts'])) $_GET['exts'] = '';
  32. if (!isset($_GET['exts'])) $directory = '';
  33.  
  34. include("header.inc.php");
  35. ?>
  36.  
  37.  
  38. <div id="body">
  39.     <div class="container">        
  40.         <div class="content_left">
  41.             <img src="images_easyphp/apache.gif" width="74" height="18" alt="Apache" border="0" />
  42.             <?php version($version_apache) ?>
  43.         </div>
  44.         <div class="content_right">        
  45.             <?php
  46.             button($alias_title, "index.php", "", "#7F7767", 1);
  47.             button($licence, "licence_apache.php", "", "#7F7F7F", 0);
  48.             echo "<br />";
  49.  
  50.             //===================================================================================================
  51.             function read_alias()
  52.             {
  53.                 global $alias, $directory, $httpd, $httpd_1, $n, $httpd_2, $httpd_3, $nb_alias, $source;
  54.                 $source = "../conf_files/httpd.conf";
  55.                 $fp = fopen($source, "r");
  56.                 $httpd = "";
  57.                 while (!feof($fp))
  58.                 {
  59.                     $conf = fgets($fp, 4096);
  60.                     $httpd = $httpd.$conf;
  61.                 }
  62.                 fclose($fp);
  63.                 $exp1 = explode("#alias",$httpd);
  64.                 $httpd_1 = $exp1[0];
  65.                 $httpd_2 = $exp1[1];
  66.                 $httpd_3 = $exp1[2];
  67.                 $exp2 = explode("Alias",$httpd_2);
  68.                         
  69.                 $n = 1;
  70.                 $nb_alias = count($exp2)-1;
  71.                 while($n<=$nb_alias)
  72.                 {
  73.                     $exp3 = explode("<Directory",$exp2[$n]);
  74.                     $alias[$n] = "Alias".$exp3[0];
  75.                     $directory[$n] = "<Directory".$exp3[1];
  76.                     $n++;
  77.                 }
  78.             }
  79.             
  80.             function list_alias()
  81.             {
  82.                 global $inc, $alias, $nb_alias, $exp4, $exp5, $alias_link, $nb_alias, $alias_name, $alias_add, $alias_delete;
  83.                 $inc = 1;
  84.                 echo "<table class='alias'>";
  85.                 while($inc <= $nb_alias)
  86.                 {
  87.                     $exp4 = explode("\"",$alias[$inc]);
  88.                     $exp5 = explode("/",$exp4[1]);
  89.                     $alias_link = $exp4[3];
  90.                     $alias_name = $exp5[1];
  91.                     $alias_link = str_replace("/","\\", $alias_link);
  92.                     echo "<tr>";
  93.                     echo "<td><img src='images_easyphp/alias.gif' width='16' height='11' alt='alias' /></td>";
  94.                     echo "<td class='alias_name'><a href='../$alias_name/' target='_blank'>$alias_name</a></td>";
  95.                     echo "<td class='alias_path'>  <img src='images_easyphp/alias_path.gif' width='16' height='11' alt='alias path' border='0' />$alias_link</td>";
  96.                     echo "<td>    [<a href='index.php?to=del_alias&num_alias=$inc'>$alias_delete</a>]</td>";
  97.                     echo "</tr>";
  98.                     $inc++;
  99.                 }
  100.                 echo "<tr>";
  101.                 echo "<td><img src='images_easyphp/alias_add.gif' width='16' height='11' alt='add alias' border='0' /></td>";
  102.                 echo "<td colspan='3'>";
  103.                 echo "[<a href='index.php?to=add_alias_1'>$alias_add</a>]";
  104.                 echo "</td>";                        
  105.                 echo "</tr>";
  106.                 echo "</table>";
  107.             }        
  108.                     
  109.             if ($_GET['to'] == "add_alias_1")
  110.             {
  111.                 ?>
  112.                 <form method="post" action="index.php">
  113.                 <?php echo $alias_intro ?>
  114.                 <br />
  115.                 <img src="images_easyphp/num_1.gif" width="14" height="18" alt="1." class="alias_img" /><?php echo $alias_1 ?>
  116.                 <br />
  117.                 <img src="images_easyphp/num_2.gif" width="14" height="18" alt="2." class="alias_img" /><?php echo $alias_2 ?>
  118.                 <br />
  119.                 <input type="text" name="alias_name" size="50" /><br />
  120.                 <img src="images_easyphp/num_3.gif" width="14" height="18" alt="3." class="alias_img" /><?php echo $alias_3 ?>
  121.                 <br />
  122.                 <input type="text" name="alias_link" size="50" /><br />
  123.                 <img src="images_easyphp/num_4.gif" width="14" height="18" alt="4." class="alias_img" /><?php echo $alias_4 ?>
  124.                 <br />
  125.                 <?php
  126.                 $textarea = "Options FollowSymLinks Indexes\r\nAllowOverride None\r\nOrder deny,allow\r\nAllow from 127.0.0.1\r\ndeny from all\r\n";        
  127.                 ?>
  128.                 <textarea name="dir" cols="40" rows="5"><?php echo $textarea ?></textarea>
  129.                 <br />
  130.                 <img src="images_easyphp/num_5.gif" width="14" height="18" alt="5." class="alias_img" /><?php echo $alias_5 ?>
  131.                 <br />
  132.                 <img src="images_easyphp/num_6.gif" width="14" height="18" alt="6." class="alias_img" /><?php echo $alias_6 ?>
  133.                 <br /><br />
  134.                 <input type="hidden" name="to" value="add_alias_2" />
  135.                 <input type="image" src="images_easyphp/ok.gif" />
  136.                 <br /><br />
  137.                 <?php echo $alias_rem ?>
  138.                 </form>
  139.                                      
  140.                 <?php
  141.             }
  142.             elseif ($_POST['to'] == "add_alias_2")
  143.             {
  144.                 /*  alias name tests  */
  145.                 read_alias();
  146.                 $name_test = TRUE;
  147.                 $inc = 1;
  148.                 while($inc <= $nb_alias)
  149.                 {
  150.                     $exp4 = explode("\"",$alias[$inc]);
  151.                     $exp5 = explode("/",$exp4[1]);
  152.                     $alias_name = $exp5[1];
  153.                     if (stristr($_POST['alias_name'], $alias_name) !== FALSE)
  154.                     {
  155.                         $name_test = FALSE;
  156.                     }
  157.                     $inc++;
  158.                 }
  159.                 
  160.                 $banned = array("alias", "directory", "home", "error", "icons", "manual");
  161.                 foreach ($banned as $value) {
  162.                     if (stristr($_POST['alias_name'], $value) !== FALSE)
  163.                     {
  164.                         $name_test = FALSE;
  165.                     }
  166.                 }
  167.                 
  168.                 if ($_POST['alias_name'] == "")
  169.                 {
  170.                     echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_1<br />";
  171.                     echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
  172.                 }
  173.                 elseif ($_POST['alias_link'] == "")
  174.                 {
  175.                     echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_2<br />";
  176.                     echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
  177.                 }
  178.                 elseif ($_POST['alias_link'] != "" & !is_dir($_POST['alias_link']))
  179.                 {
  180.                     echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_3<br />";
  181.                     echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
  182.                 }
  183.                 elseif ($name_test == FALSE)
  184.                 {
  185.                     echo "<img src='images_easyphp/exclam.gif' width='8' height='14' alt='warning' />$alias_warning_4<br />";
  186.                     echo "[ <a href=\"javascript:history.back()\">$alias_back</a> ]";
  187.                 }                
  188.                 else
  189.                 {
  190.                     read_alias();
  191.                     $dir = ereg_replace("\r\n","\n",$_POST['dir']);
  192.                     $alias_link = str_replace("\\","/", $_POST['alias_link']);
  193.                     
  194.                     if (substr($alias_link, -1) == "/"){$alias_link = substr($alias_link,0,strlen($alias_link)-1);}
  195.                     $new_alias = "Alias \"/";
  196.                     $new_alias .= $_POST['alias_name'];
  197.                     $new_alias .= "\" \"";
  198.                     $new_alias .= $alias_link;
  199.                     $new_alias .= "/\"\n";
  200.                     $new_alias .= "<Directory \"$alias_link\">\n".$dir."</Directory>\r\n";
  201.                     $conf = $httpd_1."#alias".$httpd_2.$new_alias."#alias".$httpd_3;
  202.                     $fp2 = fopen($source, "w");
  203.                     fputs($fp2,$conf);
  204.                     fclose($fp2);
  205.                     read_alias();
  206.                     list_alias();
  207.                 }
  208.             }
  209.             elseif ($_GET['to'] == "del_alias")
  210.             {
  211.                 read_alias();
  212.                 $conf_del_alias = $httpd_1."#alias\n";
  213.                 $x = 1;
  214.                 while($x<=$nb_alias)
  215.                 {
  216.                     if ($x != $_GET['num_alias'])
  217.                     {
  218.                         $conf_del_alias = $conf_del_alias.$alias[$x].$directory[$x];
  219.                     }
  220.                     $x++;
  221.                 }
  222.                 $conf_del_alias = $conf_del_alias."#alias".$httpd_3;
  223.                 $fp3 = fopen($source, "w");
  224.                 fputs($fp3,$conf_del_alias);
  225.                 fclose($fp3);
  226.                 read_alias();
  227.                 list_alias();
  228.             }
  229.             else
  230.             {
  231.                 read_alias();
  232.                 list_alias();
  233.             }
  234.             //===========================================================================================
  235.             ?>            
  236.         </div>
  237.  
  238.         <div class="content_left">
  239.             <img src="images_easyphp/php.gif" width="38" height="18" alt="PHP" border="0" />
  240.             <?php version($version_php) ?>
  241.         </div>
  242.         <div class="content_right">
  243.             <?php
  244.             button($extensions_title, "index.php", "", "#7F7767", 1);
  245.             button($phpinfo, "phpinfo.php", "", "#7F7767", 0);
  246.             button($licence, "licence_php5.php", "", "#7F7F7F", 0);
  247.                     
  248.             //===========================================================================================
  249.             echo "<div class='extensions'>";
  250.             $extensions = @get_loaded_extensions();
  251.             printf($extensions_nb . " ", count($extensions));
  252.             printf("[<a href='index.php?to=ext'>%s</a>]<br />", $extensions_show);
  253.             if ($_GET['to']=="ext")
  254.             {
  255.                 @sort($extensions);
  256.                 foreach($extensions as $extension)
  257.                 {
  258.                     echo "<div><img src='/images_easyphp/extension.gif' width='16' height='11' alt='extension' border='0' /><span class='extension_name'>$extension</span>  [<a href='index.php?to=ext&exts=$extension'>$extensions_functions</a>]</div>";
  259.                     if ($_GET['exts']==$extension)
  260.                     {
  261.                         $functions = @get_extension_funcs($_GET['exts']);
  262.                         @sort($functions);
  263.                         foreach($functions as $function)
  264.                         {
  265.                             echo "<div class='function_name'><img src='images_easyphp/function.gif' width='16' height='11' alt='function' border='0' />" . $function . "</div>";
  266.                         }
  267.                         echo "<br />";
  268.                     }
  269.                 }
  270.             }
  271.             echo "</div>";
  272.             //===========================================================================================
  273.             ?>
  274.         </div>    
  275.  
  276.  
  277.         <div class="content_left">    
  278.             <img src="images_easyphp/phpmyadmin.gif" width="128" height="18" alt="PhpMyAdmin" border="0" />
  279.             <?php version($version_phpmyadmin) ?>
  280.         </div>
  281.         <div class="content_right">
  282.             <?php
  283.             button($mysql_manager, "mysql", "target='_blank'", "#7F7767", 0);
  284.             button($licence, "licence_phpmyadmin.php", "", "#7F7F7F", 0);
  285.             ?>
  286.         </div>
  287.  
  288.  
  289.         <div class="content_left">
  290.             <img src="images_easyphp/sqlitemanager.gif" width="158" height="18" alt="SQLite" border="0" />
  291.             <?php version($version_sqlitemanager) ?>
  292.         </div>
  293.         <div class="content_right">
  294.             <?php
  295.             button($sqlite_manager, "sqlite", "target='_blank'", "#7F7767", 0);
  296.             button($licence, "licence_sqlitemanager.php", "", "#7F7F7F", 0)
  297.             ?>
  298.         </div>    
  299.  
  300.  
  301.         <div class="content_left">
  302.             <img src="images_easyphp/mysql.gif" width="68" height="18" alt="MySQL" border="0" />
  303.             <?php version($version_mysql) ?>
  304.         </div>
  305.         <div class="content_right">
  306.             <?php button($licence, "licence_mysql.php", "", "#7F7F7F", 0) ?>
  307.         </div>
  308.  
  309.     </div>    
  310. </div>
  311.  
  312. </body>
  313. </html>